x_coords = []  # 存储所有矩形的x坐标
y_coords = []  # 存储所有矩形的y坐标
rectangles = []  # 存储所有矩形的左上角和右下角坐标
for _ in range(3):
    x1, y1, w, h = list(map(int, input().split()))
 
    x2 = x1 + w  # 计算矩形的右上角x坐标
    y2 = y1 - h  # 计算矩形的右上角y坐标
    x_coords += [x1, x2]
    y_coords += [y1, y2]
    rectangles.append((x1, y1, x2, y2))

min_x_coord, max_x_coord = min(x_coords), max(x_coords)  # 计算矩形区域的最小和最大x坐标
min_y_coord, max_y_coord = min(y_coords), max(y_coords)  # 计算矩形区域的最小和最大y坐标
x_offset = 0 - min_x_coord  # 计算x坐标的偏移量
y_offset = 0 - min_y_coord  # 计算y坐标的偏移量

intersection_area = [[0] * abs(max_y_coord - min_y_coord) for _ in range(abs(max_x_coord - min_x_coord))]  # 创建表示矩形区域的二维数组

for x1, y1, x2, y2 in rectangles:
    for i in range(min((x2, x1)) + x_offset, max((x2, x1)) + x_offset):
        for j in range(min((y2, y1)) + y_offset, max((y2, y1)) + y_offset):
            intersection_area[i][j] += 1  # 在相应的区域加1

ret = 0
for i in range(len(intersection_area)):
    for j in range(len(intersection_area[0])):
        if intersection_area[i][j] == 3:  #  区域值为3时表示3个矩形重合
            ret += 1

print(ret)  # 输出相交的面积